import request from '@/utils/request'


/**
 * @description 我的任务
 */
export const apiGetTask = (type:number,page_no:number=1) => request.get({ url: '/task/lists',data:{type,page_no}})

/**
 * @description 拉取未发布的临时任务
*/
export const apiGetTempTask = () => request.get({ url: '/task/temptask'})


/**
 * @description 获取正在执行的任务
 */
export const apiWorkingTask = () => request.get({ url: '/task/workingTask'})
/**
 * @description 开始任务
*/
export const apiStartTask = (params: any) => request.post({ url: '/task/start', data: params})

/**
 * @description 添加任务
 **/
export const apiAddTask = (params: any) => request.post({ url: '/task/add', data: params})

/**
 * @description 删除任务,未发布的任务可以删除
 **/
export const apiDelTask = (params: any) => request.post({ url: '/task/del', data: params})

/**
 * @description 完成任务,在任务过程中可以完成
 */
export const apiCompleteTask = (params: any) => request.post({ url: '/task/complete', data: params})

/**
 * @description 取消任务,在任务过程中可以取消
 **/
export const apiCancelTask = (params: any) => request.post({ url: '/task/cancel', data: params})

/**
 * @description 修改任务
 **/
export const apiEditTask = (params: any) => request.post({ url: '/task/edit', data: params})

/**
 * @description 分享任务,发布任务
 * */
export const apiShareTask = (params: any) => request.post({ url: '/task/share', data: params})

export const apiGetTaskByShare = (params: any) => request.post({ url: '/task/queryTask', data: params})

export const apiGetStatistic = () => request.get({ url: '/task/statistics'})